from rest_framework import serializers
from .models import Area
class AreaInfoSerializer(serializers.ModelSerializer):
    class Meta:
        model = Area
        fields = ("id","name")
        # 这个是会返回的类容么？？是的

class AreaSubInfoSerializer(serializers.ModelSerializer):
    subs = AreaInfoSerializer(read_only=True,many=True)
    # read_only = True, many = True这两个是什么鬼？因为不用校验所以只读，
    class Meta:
        model = Area
        fields = ("id","name","subs")
        # 为什么要传id subs???

